package com.hm.cms.domain;

import com.hm.cms.auto.su.BaseDomain;
import com.hm.cms.auto.su.R;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @author shishun.wang
 * @date 2017年10月31日 下午10:41:29
 * @version 1.0
 * @describe
 */
@Setter
@Getter
@Document(collection = R.Database.prefix + "VISIT_IP_HISTORY")
@CompoundIndexes({ @CompoundIndex(name = "ip", def = "{'ip': 1}"),
        @CompoundIndex(name = "ip,visit_date", def = "{'ip': 1, 'visit_date': 1}") })
public class VisitIpHistoryDomain extends BaseDomain {

    private static final long serialVersionUID = 1L;

    private String ip;

    /**
     * 请求地址
     */
    @Field(value = "req_uri")
    private String reqUri;

    /**
     * 访问时间，精确到天
     */
    @Field(value = "visit_time")
    private String visitTime;
}
